package cn.icare.cms.controller.restful;


import cn.icare.cms.OrderService;
import cn.icare.cms.model.enums.OrderStatusEnum;
import cn.icare.cms.model.vo.rest.RespMsgVO;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping(value = "/rest/statistic")
@Api(tags = "REST首页统计报表")
public class StatisticController extends BaseController {

    @Autowired
    private OrderService orderService;

    /**
     * URL:http://{ip}:{port}/rest/coupon?args={args}
     * method:GET
     *
     * @return
     */
    @GetMapping("/weekorder")
    @ApiOperation(value = "查询本周订单数", notes = "查询本周订单数")
    public ResponseEntity<RespMsgVO> getWeekOrderList() {
        return super.getRespOk(this.orderService.statisticOrderList(OrderStatusEnum.ALL.getCode()));
    }

}
